﻿<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html" ; charset="utf-8" />
    <title>教务信息查询</title>
    <link href="../../../css/main.css" rel="stylesheet" type="text/css">
    <link href="../../../bstable/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="../../../bstable/css/bootstrap-table.css" rel="stylesheet" type="text/css">
    
</head>

<body>
    <div class="tabe_div">
        <table data-url="json/data_alae_list.json" id="table" class="table_style" style="margin: 20px auto">
        </table>
    </div>
    <script src="../../../js/jquery.js"></script>
    <script src="../../../js/common.js"></script>
    <script src="../../../js/laydate-master/laydate.js"></script>
    <script src="../../../bstable/js/bootstrap.min.js"></script>
    <script src="../../../bstable/js/bootstrap-table.js"></script>
    <script src="../../../bstable/js/bootstrap-table-zh-CN.min.js"></script>
    <script type="text/javascript">
        localStorage.setItem('name', '教务管理/工作流查询/工作流')
        function getQuery(variable) {
            var query = window.location.search.substring(1);
            var vars = query.split("&");
            for (var i = 0; i < vars.length; i++) {
                var pair = vars[i].split("=");
                if (pair[0] == variable) {
                    return pair[1];
                }
            }
            return (false);
        }
        var studentId = getQuery('id')
        $(function () {
            $('#search').on('click', function() {
                $('#table').bootstrapTable('refresh')
            })

            $('#table')
                .bootstrapTable({
                    method: "get",
                    striped: true,
                    singleSelect: false,
                    url: baseUrl + 'studentInfo/workFlow',
                    dataType: "json",
                    pagination: true, //分页
                    sidePagination:"server",
                    pageSize: 10,
                    pageNumber: 1,
                    search: false, //显示搜索框
                    contentType: "application/x-www-form-urlencoded",
                    ajaxOptions:{
                        headers: {"Authorization": JSON.parse(localStorage.getItem('userInfo')).token}
                    },
                    queryParams: function(params) {
                        params.studentId = studentId
                        params.offset = params.offset / params.limit
                        return params
                    },
                    responseHandler: function(res) {
                        var list = res.data.length ?  res.data : []
                        list.forEach(function(item,i ) {
                            !item && (list[i] = {})
                        })
                        console.log(list)
                        return {
                            rows: list,
                            total: list.length
                        }
                    },
                    columns: [
                        {
                            field: 'no',
                            title: '序号',
                            sortable: true,
                            align: "center",
                            formatter: function (value, row, index) {
                                var pageSize=$('#table').bootstrapTable('getOptions').pageSize;
                                var pageNumber=$('#table').bootstrapTable('getOptions').pageNumber;
                                return pageSize * (pageNumber - 1) + index + 1;
                            }
                        },
                        {
                            title: '操作人姓名',
                            field: 'operaterName',
                            align: 'center',
                            valign: 'middle'
                        },
                        {
                            title: '操作人时间',
                            field: 'createDate',
                            align: 'center'
                        },
                        {
                            title: '具体操作',
                            field: 'operateMsg',
                            align: 'center'
                        }
                    ]
                });
        });

        function upload(id) {
            window.location.href = './upload.html'
        }
    </script>
</body>

</html>